﻿@{
  ViewBag.Title = "立项列表";
  Layout = "~/Views/Shared/_Layout.cshtml";
}
@section mystyle{

}
<!-- search -->
<div class="content margin-top-20" id="search-box">
  <div class="container">
    <div class="row">
      <div class="col-sm-12">
        <div class="box padding-top-10 padding-bottom-10">
          <form class="form-inline">
            <div class="form-group">
              <label for="" class="margin-left-10">项目名称</label>
              <input type="search" name="search" id="search" class="form-control margin-left-10">
            </div>

            <div class="form-group">
              <label for="" class="margin-left-10">时间</label>
              <div class="datepk-box c-select vm w240 pop-style vm margin-left-10">
                <input type="text" name="" id="" readonly class="datepk form-control">
                <span class="c-select-btn"></span>
              </div>

              <span class="padding-left-10 padding-right-10 vm">至</span>

              <div class="datepk-box c-select vm w240 pop-style vm">
                <input type="text" name="" id="" readonly class="datepk form-control">
                <span class="c-select-btn"></span>
              </div>
              <!--<div class="input-group input-daterange search-date">
                <input type="text" class="form-control" name="" id="">
                <span class="input-group-addon">至</span>
                <input type="text" class="form-control" name="" id="">
              </div>-->
              <label for="search"><span class="glyphicon glyphicon-search margin-10 font-16"></span></label>
            </div>

          </form>
        </div>
      </div>
    </div>
  </div>
</div>
<!-- table -->
<div class="padding-top-10 padding-bottom-10 margin-top-20">
  <div class="container">
    <div class="row">
      <div class="col-sm-12">
        <button type="button" class="btn btn-warning" id="addProject">
          <i class="glyphicon glyphicon-list-alt"></i>
          <span class="margin-left-10">新建项目</span>
        </button>
      </div>

      <div id="table" class="col-sm-12 margin-top-20">
        <table class="table text-center" id="listTable">

        </table>
      </div>

      <div class="col-sm-12 clearfix">
        <!--<div class="pages"></div>-->
        <p class="float-left">总条数：<span id="totalRow">20</span></p>

        <div class="table-pagination float-right line-height-34 margin-left-10 text-center" id="pages"></div>

        <div class="float-right">
          <form class="form-inline">
            <span>显示条数：</span>
            <select name="pageSize" id="pageSize" class="form-control">
              <option value="10">10</option>
              <option value="20">20</option>
              <option value="30">30</option>
            </select>
          </form>
        </div>


      </div>
    </div>
  </div>
</div>

<!-- 立项 -->
<div class="modal fade" id="initProject" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content padding-10 w700">
      <div class="text-right">
        <a class="close-pop" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span></a>
      </div>
      <div>
        <div class="row">
          <div class="col-sm-12"><h3 class="margin-10" id="projectTitle">项目</h3></div>
        </div>
        <form class="form-horizontal">
          <div class="form-group">
            <label for="td1" class="col-sm-3 control-label">项目名称</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" name="td1" id="td1" placeholder="项目名称">
            </div>
          </div>
          <div class="form-group">
            <label for="td4" class="col-sm-3 control-label">品牌</label>
            <div class="col-sm-8">
              <select name="td4" id="td4" class="form-control">
                <option value="1">捷豹路虎</option>
                <option value="2">五菱宝骏</option>
                <option value="3">奔驰</option>
                <option value="4">...</option>
              </select>
            </div>
          </div>
          <div class="form-group">
            <label for="td2" class="col-sm-3 control-label">项目阶段</label>
            <div class="col-sm-8">
              <select name="td2" id="td2" class="form-control">
                <option value="1">沟通</option>
                <option value="2">执行</option>
                <option value="3">...</option>
              </select>
            </div>
          </div>
          <div class="form-group">
            <label for="td3" class="col-sm-3 control-label">项目类型</label>
            <div class="col-sm-8">
              <select name="td3" id="td3" class="form-control">
                <option value="1">高新</option>
                <option value="2">传统</option>
                <option value="3">...</option>
              </select>
            </div>
          </div>
          <div class="form-group">
            <label for="td5" class="col-sm-3 control-label">项目时间</label>
            <div class="col-sm-8">
              <!--<div class="datepk-box c-select vm w240 pop-style vm">
                <input type="text" name="td5" id="td5" readonly class="datepk form-control">
                <span class="c-select-btn"></span>
              </div>

              <span class="padding-left-10 padding-right-10 vm">至</span>

              <div class="datepk-box c-select vm w240 pop-style vm">
                <input type="text" name="td6" id="td6" readonly class="datepk form-control">
                <span class="c-select-btn"></span>
              </div>-->
              <div class="input-group input-daterange">
                <input type="text" class="form-control" name="td5" id="td5" readonly>
                <span class="input-group-addon">至</span>
                <input type="text" class="form-control" name="td6" id="td6" readonly>
              </div>
            </div>
          </div>

          <div class="form-group">
            <div class="col-sm-3 col-sm-offset-3">
              <button type="button" id="save" class="btn btn-danger btn-block">保存</button>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>

<script id="PROJECT_STAGE" type="text/html">
  {{each PROJECT_STAGE as value i}}
  <option value="{{value.ID}}">{{value.Text}}</option>
  {{/each}}
</script>

<script id="PROJECT_TYPE" type="text/html">
  {{each PROJECT_TYPE as value i}}
  <option value="{{value.ID}}">{{value.Text}}</option>
  {{/each}}
</script>

<script id="PROJECT_BRAND" type="text/html">
  {{each PROJECT_BRAND as value i}}
  <option value="{{value.ID}}">{{value.Text}}</option>
  {{/each}}
</script>

<script id="l2List" type="text/html">
  <thead>
  <tr>
    <th></th>
    <th>项目名称</th>
    <th>项目类型</th>
    <th>项目时间</th>
    <th>项目阶段</th>
    <th>状态</th>
    <th class="w250">操作</th>
  </tr>
  </thead>
  <tbody>
  {{each $data}}
  <tr>
    <td>{{$index + 1}}</td>
    <td>{{$value.Name}}</td>
    <td>{{$value.ProjectType}}</td>
    <td>{{$value.StartDate}} - {{$value.EndDate}}</td>
    <td>{{$value.State}}</td>
    <td></td>
    <td>
      {{if $value.State === '未立项' || $value.State == '' || $value.State == '审批未通过' }}
      <button type="button" class="btn btn-success submitProject">提交</button>
      <button type="button" class="btn btn-primary btn-edit editProject">编辑项目</button>
      <button type="button" class="btn btn-danger delProject">删除</button>
      {{else if  $value.State === '项目结束'}}
      <button type="button" class="btn btn-success" disabled="disabled">已提交</button>
      <button type="button" class="btn btn-primary" disabled="disabled">编辑项目</button>
      <button type="button" class="btn btn-danger delProject">删除</button>
      {{else}}
      <button type="button" class="btn btn-success" disabled="disabled">已提交</button>
      <button type="button" class="btn btn-primary" disabled="disabled">编辑项目</button>
      <button type="button" class="btn btn-danger" disabled="disabled">删除</button>
      {{/if}}
    </td>
  </tr>
  {{/each}}
  </tbody>

</script>
@section myscript{
  <script>
    var state = '1';
  </script>
  <script src="~/Content/js/bind2.js"></script>
}